﻿<script language ="javascript" type ="text/javascript" >
     <!--
       function leftTrim(sIn)
       {
	     var sOut = sIn;
	     var regExp = new RegExp("^&nbsp;");
	     while(regExp.test(sOut))
		   sOut = sOut.replace(regExp, "");
	     return sOut
       }

       function rightTrim(sIn)
       {
	     var sOut = sIn;
	     var regExp = new RegExp("&nbsp;$");
	     while(regExp.test(sOut))
		    sOut = sOut.replace(regExp, "");
	     return sOut
       }

      function trim(sIn)
      {
	    return leftTrim(rightTrim(sIn));
      }

function isContained(sComparand,sList,sDivision){
	if(sComparand==null||sComparand==""||sList==null||sList==""||sDivision==null||sDivision=="")
		return false;
  var sCorrectorList = sList;
	var nLength = sList.length;
  if(sCorrectorList.substr(nLength-1)!=sDivision)
		sCorrectorList = sList + sDivision;
 	while(sCorrectorList.length!=0){
    var index = sCorrectorList.indexOf(sDivision);
    var sMenber = sCorrectorList.substring(0,index);
    if(sMenber==sComparand) return true;
    sCorrectorList = sCorrectorList.substr(index+1);
  }
	return false;
}

//被选中后的背景色
 var tgs;
 var tmp_background_val;
 function tog(n,flags)
 {
   if (tgs)
   {
     tgs.style.background= tmp_background_val ;
   }
   n.style.background= '#A0CBFF';
   tmp_background_val=flags;
   tgs=n;
 }
 
 //日期控件
 function fPopUpCalendarDlg(ctrlobj)  //日期速查
  {
	showx = event.screenX - event.offsetX - 4 ; // + deltaX;
    showy = event.screenY - event.offsetY + 18; // + deltaY;
	newWINwidth = 210 + 4 + 18;

	retval = window.showModalDialog("../js/CalendarDlg.htm", "", "dialogWidth:197px; dialogHeight:210px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;help:no;scrollbars:no;Resizable=no; "  );
	if( retval != null )
	{
	  ctrlobj.value = retval;
	}
	else
	{
					//alert("canceled");
	}
	  ctrlobj.blur();
  }
  
  //日期控件
 function SearchCalendarDlg(ctrlobj)  //日期速查
  {
	showx = event.screenX - event.offsetX - 4 ; // + deltaX;
    showy = event.screenY - event.offsetY + 18; // + deltaY;
	newWINwidth = 210 + 4 + 18;

	retval = window.showModalDialog("../js/CalendarDlg.htm", "", "dialogWidth:197px; dialogHeight:210px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;help:no;scrollbars:no;Resizable=no; "  );
	if( retval != null )
	{
	  ctrlobj.value = retval;
	}
	else
	{
					//alert("canceled");
	}
	  ctrlobj.blur();
	  window.form1.CartTimes.focus();
  }
  
 // -->
</script>
